import RemarkHTML from "remark-html";

const path = require("path")
const config = {
  entry: './src/main.js', // 打包入口
  output: { // 打包出库
    path: path.resolve(__dirname, 'dist'), // __dirname node定义的根目录
    filename: 'my-first-webpack.bundle.js',
  },
  module: { // 依赖模块
    rules: [
      {
        test: /\.css$/,
        use: ['style-loader', 'css-loader']
      },
      {
        test: /\.md$/,
        use: [
          {
            loader: "html-loader",
          },
          {
            loader: "remark-loader",
            options: {
              remarkOptions: {
                plugins: [RemarkHTML],
              },
            },
          },
        ],
      },
    ]
  }
}

export default config;